#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : qq.py
# @Author: 1234
# @Date  : 19-6-13
# @Desc  :

from tkinter import *

class Reg (Frame):
    def __init__(self,master):
        frame = Frame(master)
        frame.pack()
        self.lab1 = Label(frame,text = "账户:")
        self.lab1.grid(row = 0,column = 0,sticky = W)
        self.ent1 = Entry(frame)
        self.ent1.grid(row = 0,column = 1,sticky = W)
        self.lab2 = Label(frame,text = "密码:")
        self.lab2.grid(row = 1,column = 0)
        self.ent2 = Entry(frame,show = "*")
        self.ent2.grid(row = 1,column = 1,sticky = W)
        self.button = Button(frame,text = "登录",command = self.Submit)
        self.button.grid(row = 3,column = 1,sticky = E)
        self.button2 = Button(frame,text = "退出",command = frame.quit)
        self.button2.grid(row = 3,column = 2,sticky = E)
        self.lab3 = Label(frame,text = "")
        self.lab3.grid(row = 4,column = 0,sticky = W)
    def Submit(self):
        s1 = self.ent1.get()
        s2 = self.ent2.get()
        if s1 == '123456' and s2 == '123456':
            self.lab3["text"] = "登陆成功"

            root.destroy()
            global top2
            top2 = Tk()
            top2.title('QQ主界面')
            top2.geometry('300x600')
            scale = Scale(top2, from_=100, to=200, orient=HORIZONTAL, command=resize)
            scale.set(12)
            scale.pack(fill=X, expand=1)

        else:
            self.lab3["text"] = "用户名或密码错误!"
        self.ent1.delete(0,len(s1))
        self.ent2.delete(0,len(s2))
root = Tk()
root.title("QQ登录")
app = Reg(root)



root.mainloop()